import React from "react";
import { Tabs } from "expo-router";
import { Ionicons } from "@expo/vector-icons";
import { PlatformPressable } from "@react-navigation/elements";

export default function TabLayout() {
  return (
    <Tabs
      screenOptions={{
        //  使用 PlatformPressable 作为 tabBarButton
        tabBarButton: (props) => (
          <PlatformPressable
            {...props}
            pressColor="transparent" // 安卓: 设置水波纹颜色为透明
            pressOpacity={1} // iOS: 设置点击后的不透明度为 1 (即不变化),ps.iOS 的默认点击效果是降低组件的透明度
          />
        ),
      }}
    >
      <Tabs.Screen
        name="(standard-home)"
        options={{
          tabBarIcon: ({ color, focused }) => (
            <Ionicons name="extension-puzzle-outline" size={24} color="black" />
          ),
          headerShown: false,
          title: "组件",
        }}
      />
      <Tabs.Screen
        name="(mine)"
        options={{
          tabBarIcon: ({ color, focused }) => (
            <Ionicons name="person-outline" size={24} color="black" />
          ),
          headerShown: false,
          title: "我的",
        }}
      />
    </Tabs>
  );
}
